tg-me.com/python_codes/213
Last Update:
What is a map function in Python?
The map() function in Python has two parameters, function and iterable. The map() function takes a function as an argument and then applies that function to all the elements of an iterable, passed to it as another argument. It returns an object list of results.
Example:def calculateSq(n):
Share and Support
return n*n
numbers = (2, 3, 4, 5)
result = map( calculateSq, numbers)
print(result)
@Python_Codes
BY Python Codes
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/python_codes/213